import axios from "axios";
import showMessage from "../utils/showMessage.js";

const instance = axios.create();

instance.interceptors.response.use((resp) => {
    if(resp.data.code){
        showMessage({
            type: "error",
            content: resp.data.msg
        });
        return null;
    }
    return resp.data.data;
});

export default instance;
